load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "cdcutil",
    srcs = ["cdc.go"],
    importpath = "github.com/pingcap/tidb/pkg/util/cdcutil",
    visibility = ["//visibility:public"],
    deps = [
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_log//:log",
        "@io_etcd_go_etcd_client_v3//:client",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "cdcutil_test",
    timeout = "short",
    srcs = [
        "cdc_test.go",
        "export_for_test.go",
    ],
    embed = [":cdcutil"],
    flaky = True,
    deps = [
        "@com_github_stretchr_testify//require",
        "@io_etcd_go_etcd_client_v3//:client",
        "@io_etcd_go_etcd_tests_v3//integration",
    ],
)
